<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
		<title>来拍车App-投标中拍单详情页</title>
		<link rel="stylesheet" href="{:get_style_cdnurl()}app/css/home.css">
        <link rel="shortcut icon" href="{:get_style_cdnurl()}app/images/favicon.ico" >
		<script src="{:get_style_cdnurl()}app/js/jquery-1.11.1.js" type="text/javascript"></script>
		<script src="{:get_style_cdnurl()}app/js/conversion.js" type="text/javascript"></script>
        <script src="{:get_style_cdnurl()}paimai/cheshan/js/common.js" type="text/javascript"></script>
        <script src="{:get_style_cdnurl()}paimai/cheshan/js/TGJSBridge.js" type="text/javascript"></script>
        <script src="{:get_style_cdnurl()}paimai/cheshan/js/appclient.js" type="text/javascript"></script>
        <script>
        function run_zhong(left_time){
                    left_time=typeof(left_time)=='undefined'?0:left_time;
                    var cd = new CountDown(parseInt(left_time));
                    cd.set_show_tpl(function(data){ //设置展示模板
                    $('#clock1').html('<em>'+data.o+'</em>时<em>'+data.m+'</em>分<em>'+data.s+'</em>秒')
                    });
                    cd.over(function(o){appClient.reload()});
        }
        document.documentElement.style.webkitUserSelect='none';
        document.documentElement.style.webkitTouchCallout='none';
        //告知客户端当前拍单关注情况
        appClient.setFollow({$head[is_followed]?1:0});
        </script>
	</head>
	<body>
    <div id="mainContent" >
		<section class="auction">
			<div id="slide"><a href="javascript:appClient.openBasePic('{$head.car_id}');"><img src="{$head.car_pic}" /></a></div>
			<div class="slide-text">
				<h3>{$head.model_show}</h3>
				<span>{$head.first_reg_date}初登/{$head.pointer_mileage}万公里/{$head.emission}/{$head.plate}/{$head.transfer_limit}</span>
			</div>
			<div class="grade" onclick="javascript:appClient.openLevelRules();"><strong>{$head.composite_state}{$head.acc_level}</a></strong></div>
		</section>
		
		<section class="auction-pai">
			<dl class="clearfix">
				<dt><strong>投标中</strong></dt>
				<dd>距投标结束仅剩<span id="clock1" ><em>{$head.time_to_end_bid.h}</em>时<em>{$head.time_to_end_bid.i}</em>分<em>{$head.time_to_end_bid.s}</em>秒</span></dd>
                <script>run_zhong('{$head.left_time}')</script>
			</dl>
			<div class="starting">
				起拍价:<em class="currMoney"><i id="currMoney">{$head.bid_start_price_show}</i></em>元
				<span>
                                    <if condition="$head['show_reserve_price'] eq 1">保留价：{$head['reserve_price']}元　</if>
                                    <if condition="$head[coupon] gt 0"> 可用代金券金额:{$head.coupon}元</if>
                                </span>
			</div>
		</section>
		
		<section class="auction-record">
			<samp>您的投标价: <em id="bid">{$my_last_bid_price_show}</em>元</samp>
			<span class="record-none">竞拍预计{$head.bidding_start_time}开始，敬请关注！</span>
		</section>
		
		<section class="auction-wenben">
			<ul class="clearfix">
				<li>起拍价：{$head.bid_start_price_show}元</li>
				<li>
                                    保留价：
                                    <if condition="$head['show_reserve_price'] eq 1">
                                        {$head['reserve_price']}元
                                        <else/>
                                        <if condition="$head['reserve_price'] gt 0">有<else/>无</if>
                                    </if>
                                </li>
				<li>过户费：{$head.transfer_fee|floatval}元 </li>
				<li>佣金 ：{$head.commision|floatval}元</li>
			</ul>
			<span>竞价成功的车辆，过户费、佣金由买方承担。</span>
		</section>
		
		<section class="auction-btn clearfix auction-btn2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        "><a href="javascript:appClient.openReport('{$head.car_id}');"><img src="{:get_style_cdnurl()}app/images/icon3.png" />检测报告</a><div class="stroke"></div></section>
		</div>
        <!--浮动-->
        <section class="price clearfix">
			<input type="number" id="money" name="price" placeholder="高于起拍价，且为100的倍数。" class="price-text" maxlength="7" oninput="showChineseAmount()" />
			<input type="text" value="" id="C_money" />
			<div class="alert-text">您的出价已超过保留价！</div>
			<input type="button" value="出价" class="price-btn" />
		</section>
		<script>
        var ua = navigator.userAgent.toLowerCase();
        if (/iphone|ipad|ipod/.test(ua)) {
              $("#mainContent").addClass("mainContent");
        }
		$(document).ready(function() {
            var order_id = '{$head.order_id}';
            var dealer_id = '{$head.dealer_id}';

            $("#money").keyup(function(){
                if($(this).val()==""){
                     $("#C_money").hide();
                }
            });

			$(".price-btn").click(function(){
                $(".price #C_money").hide();
				var cuurM=parseFloat($(".starting .currMoney").text());//当前价格数字
				var nowM=parseFloat($("#money").val())/10000;
				var nowB=parseInt($("#money").val());							
				if($("#money").val()==""){
                     $(".alert-text").fadeIn().html("请输入您的出价").delay(2000).fadeOut();
                     return false;
			    }
                if(cuurM>=10000){
                    if(nowM<cuurM){
                        $(".alert-text").fadeIn().html("不能小于当前价").delay(2000).fadeOut();
                        return false;
                    }
                }else{
                    if(nowB<cuurM){
                        $(".alert-text").fadeIn().html("不能小于当前价").delay(2000).fadeOut();
                        return false;
                    }
                }

				if(nowB%100!=0){
                      $(".alert-text").show().html("出价必须为100的整数倍").delay(2000).fadeOut();
                      return false;
				}


                var param = { 'order_id':order_id,'dealer_id':dealer_id,'price':nowB };
                //app出价
                appClient.bid(order_id,nowB);
			});
            //通知app滚动
            $(".mainContent").scroll(function(){
            				var h = $(".mainContent").scrollTop();
            				if(h==0){
            					$("body").scrollTop(0);
            					//appClient.is_top(true);

            				} else {
            					//appClient.is_top(false);
            					$("body").scrollTop(1);

            				}
            			})


	});
    //出价后操作
    function bid_rs(data){
            if(typeof(data)=='object'){
                data = eval("(" + data.str + ")");
            }else{
                data = eval("(" + data + ")");
            }
            if(data.code == '200'){
                var nowB=parseInt($("#money").val());
                if(nowB>10000){
                     $('#bid').html((nowB/10000).toFixed(2)+"<i>万</i>");
                }else{
                     $('#bid').text(nowB);
                }
                $(".alert-text").fadeIn().html("出价成功！").delay(2000).fadeOut();
                $("#money").val('');
            }else if(data.code=='200035'){
                appClient.error(200035,data.msg);
            }else{
                $(".alert-text").fadeIn().html(data.msg).delay(2000).fadeOut();
            }
    }

    appClient.bind();
</script>
	</body>
</html>
